package org.xiji.single;

/**
 * 饿汉式
 */
public class SingleEager {
    /**
     * 静态变量 类加载时就已经创建，并且只创建一次，所以是线程安全的
     */
    private static SingleEager singleEager = new SingleEager();

    /**
     * 获取单例
     */
    public static SingleEager getSingleEager(){
        return singleEager;
    }
}
